home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Classes / HashFile / HashFile.h < prev    next >
Text File  |  1995-06-12  |  2KB  |  61 lines

  1. /* File: HashFile.h - db(3) to HashTable bridge
  2.  *
  3.  * By: Christopher Lane
  4.  * Symbolic Systems Resources Group
  5.  * Knowledge Systems Laboratory
  6.  * Stanford University
  7.  *
  8.  * Date: 5 September 1991
  9.  *
  10.  * Copyright: 1990, 1991 by The Leland Stanford Junior University.  This
  11.  * program may be distributed without restriction for non-commercial use.
  12.  */
  13.  
  14. #import <stdio.h>
  15. #import <db/db.h>
  16. #import <objc/HashTable.h>
  17.  
  18. @interface HashFile : HashTable
  19. {
  20.     Database *db;
  21.     Data d;
  22.     char *filename;
  23.     BOOL readOnly;
  24.     NXStream *stream;
  25.     long offset;
  26. }
  27.  
  28. + (BOOL) isHashFile:(const char *) name;
  29.  
  30. - initFromFile:(const char *) name;
  31. - initFromFile:(const char *) name keyDesc:(const char *) aKeyDesc;
  32. - initFromFile:(const char *) name keyDesc:(const char *) aKeyDesc valueDesc:(const char *) aValueDesc;
  33.  
  34. - free;    
  35. //- freeObjects;
  36. //- freeKeys:(void (*) (void *)) keyFunc values:(void (*) (void *)) valueFunc;  
  37. - empty;
  38. //- copy;
  39.  
  40. - (unsigned) count;
  41. - (BOOL) isKey:(const void *) aKey;
  42. - (void *) valueForKey:(const void *) aKey;
  43. - (void *) insertKey:(const void *) aKey value:(void *) aValue;
  44. - (void *) removeKey:(const void *) aKey;
  45.  
  46. - (NXHashState) initState;
  47. - (BOOL) nextState:(NXHashState *) aState key:(const void **) aKey value:(void **) aValue;
  48.  
  49. //- write:(NXTypedStream *) stream; 
  50. //- read:(NXTypedStream *) stream;
  51.  
  52. - (void) _keyCvtIn:(const void *) aKey;
  53. - (void) _valueCvtIn:(const void *) aValue;
  54. - (void) _datumCvtIn:(Datum *) aDatum from:(const void *) aBuffer using:(const char *) aDesc;
  55.  
  56. - (void *) _keyCvtOut;
  57. - (void *) _valueCvtOut;
  58. - (void *) _datumCvtOut:(Datum *) aDatum using:(const char *) aDesc;
  59.  
  60. @end
  61.